<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta
	content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"
	name="viewport">
<title>whit-大数据博客 | 查看和评论 </title>
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/plugins/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/plugins/font-awesome/css/font-awesome.min.css">

<!-- Custom styles for this template -->
<link href="${pageContext.request.contextPath}/css/blog.css"
	rel="stylesheet">


<link rel="stylesheet"
	href="${pageContext.request.contextPath}/plugins/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/plugins/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/plugins/ionicons/css/ionicons.min.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/plugins/iCheck/square/blue.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/plugins/morris/morris.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/plugins/jvectormap/jquery-jvectormap-1.2.2.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/plugins/datepicker/datepicker3.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/plugins/daterangepicker/daterangepicker.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/plugins/datatables/dataTables.bootstrap.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/plugins/treeTable/jquery.treetable.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/plugins/treeTable/jquery.treetable.theme.default.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/plugins/select2/select2.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/plugins/colorpicker/bootstrap-colorpicker.min.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/plugins/bootstrap-markdown/css/bootstrap-markdown.min.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/plugins/adminLTE/css/AdminLTE.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/plugins/adminLTE/css/skins/_all-skins.min.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/css/style.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/plugins/ionslider/ion.rangeSlider.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/plugins/ionslider/ion.rangeSlider.skinNice.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/plugins/bootstrap-slider/slider.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/plugins/bootstrap-datetimepicker/bootstrap-datetimepicker.css">

</head>
<body>
	<%@ include file="/view/main/header.jsp" %>

	<div class="container">


		<div class="row">

			<div class="col-sm-12 blog-main">
				<div class="blog-post">

					<h2 class="blog-post-title">${item.title }</h2>
					<p class="blog-post-meta">${item.publishTime }
						by <a href="#">${item.username }</a>
					</p>
					<hr>
					<blockquote>
						<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ${item.content }</p>

					</blockquote>


					<div class="box-body">
						<div class="col-md-4">
							<img class="img-responsive imgClass img-rounded img-thumbnail"
								alt="" src="${picpath}${item.picurls}">
						</div>
						 
					</div>
					<hr>
					<div class="box-body">
						<ul class="nav navbar-nav">
							<button style="margin: 2px" type="submit" class="btn btn-default">
								<span class="glyphicon glyphicon-thumbs-up"></span> 点赞 <span>
									12</span>
							</button>
							<button onclick="javascript:$('#commitInput').focus()"
								style="margin: 2px" type="submit" class="btn btn-default">
								<span class="glyphicon glyphicon-edit"></span> 评论 <span>
									12</span>
							</button>
							<button style="margin: 2px" type="submit" class="btn btn-default">
								<span class="glyphicon glyphicon-send"></span> 分享 <span></span>
							</button>
							<button style="margin: 2px" type="submit" class="btn btn-default">
								<span class="glyphicon glyphicon-heart"></span> 收藏 <span>
									12</span>
							</button>
						</ul>
					</div>

					<div class="box-body">
						<ul class="timeline">
							<!-- timeline item -->
							<c:forEach items="${page.list }" var="p" varStatus="status">
								<li>
									<!-- timeline icon --> <img class="fa fa-envelope"
									style="position: absolute; left: 18px; width: 30px; height: 30px"
									src="${pageContext.request.contextPath}/images/tiger.jpg">
									<div class="timeline-item">
										<span class="time"><i class="fa fa-clock-o"></i>${p.publishTime }</span>

										<h3 class="timeline-header">
											<a href="#">${p.commitusername }</a> 说:
										</h3>

										<div class="timeline-body">${p.content }</div>

										<div class="timeline-footer">
											<a class="btn btn-primary btn-xs"> 回复 </a> <a
												class="btn btn-danger btn-xs"> 删除 </a> <a
												class="btn btn-info btn-xs"> 点赞 (12) </a>
										</div>
									</div>
								</li>
							</c:forEach>
						</ul>
					</div>
					<div class="box-body">
						<div class="box-footer">
							<div class="pull-left">
								<div class="form-group form-inline">总共${page.totalPageNum}
									页，共${page.totalRecords } 条数据。第${page.currentPageNum}页</div>
							</div>
	
							<div class="box-tools pull-left" style="float: right!important">
								<ul class="pagination">
									<li><a
										href="${pageContext.request.contextPath}/${page.url}&num=1&id=${item.id}"
										aria-label="Previous">首页</a></li>
									<li><a
										href="${pageContext.request.contextPath}/${page.url}&num=${page.prePageNum}&id=${item.id}">上一页</a></li>
	
									<c:forEach begin="${page.startPage}" end="${page.endPage}"
										var="pagenum">
										<li><a
											style="color: ${page.currentPageNum==pagenum?'#337ab7':'' }"
											href="${pageContext.request.contextPath}/${page.url}&num=${pagenum}&id=${item.id}">${pagenum}</a></li>
									</c:forEach>
	
									<li><a
										href="${pageContext.request.contextPath}/${page.url}&num=${page.nextPageNum}&id=${item.id}">下一页</a></li>
									<li><a
										href="${pageContext.request.contextPath}/${page.url}&num=${page.totalPageNum}&id=${item.id}"
										aria-label="Next">尾页</a></li>
								</ul>
							</div>
						</div>
					</div>

					

					<form id="fomr1" name="fomr1" action="${pageContext.request.contextPath}/TcommitServlet?method=add" method="post">
						<div class="box-body" >
							<div class="form-group">
								<label>发表评论</label> <input type="hidden" name="blogid"
									value="${item.id }"> <input type="hidden"
									name="userid" value="1">
								<textarea id="content" name="content" class="form-control"
									rows="3" placeholder="请在这里输入评论内容 ..."></textarea>
							</div>
							<div class="form-group">
								<button type="submit" class="btn btn-default pull-right"
									onclick="javascript:window.close();return false; ">关闭当前窗口</button>
								 
								
								<button type="submit" class="btn btn-info "  <c:if test="${loginUser == null}">style="display: none"</c:if>
									onclick="javascript:submitForm();return false;">立即回复</button>
							</div>
						</div>

					</form>
				</div>
				<!-- /.blog-post -->



			</div>
			<!-- /.blog-main -->



		</div>
		<!-- /.row -->

	</div>
	<!-- /.container -->

	<%@ include file="/view/main/foot.jsp" %>

</body>

<script
	src="${pageContext.request.contextPath}/plugins/jQuery/jquery-2.2.3.min.js"></script>
<script
	src="${pageContext.request.contextPath}/plugins/bootstrap/js/bootstrap.min.js"></script>

<script
	src="${pageContext.request.contextPath}/plugins/ckeditor/ckeditor.js"></script>


<script
	src="${pageContext.request.contextPath}/plugins/jQuery/jquery-2.2.3.min.js"></script>
<script
	src="${pageContext.request.contextPath}/plugins/jQueryUI/jquery-ui.min.js"></script>
<script>
	$.widget.bridge('uibutton', $.ui.button);
</script>
<script
	src="${pageContext.request.contextPath}/plugins/bootstrap/js/bootstrap.min.js"></script>
<script
	src="${pageContext.request.contextPath}/plugins/raphael/raphael-min.js"></script>
<script
	src="${pageContext.request.contextPath}/plugins/morris/morris.min.js"></script>
<script
	src="${pageContext.request.contextPath}/plugins/sparkline/jquery.sparkline.min.js"></script>
<script
	src="${pageContext.request.contextPath}/plugins/jvectormap/jquery-jvectormap-1.2.2.min.js"></script>
<script
	src="${pageContext.request.contextPath}/plugins/jvectormap/jquery-jvectormap-world-mill-en.js"></script>
<script
	src="${pageContext.request.contextPath}/plugins/knob/jquery.knob.js"></script>
<script
	src="${pageContext.request.contextPath}/plugins/daterangepicker/moment.min.js"></script>
<script
	src="${pageContext.request.contextPath}/plugins/daterangepicker/daterangepicker.js"></script>
<script
	src="${pageContext.request.contextPath}/plugins/daterangepicker/daterangepicker.zh-CN.js"></script>
<script
	src="${pageContext.request.contextPath}/plugins/datepicker/bootstrap-datepicker.js"></script>
<script
	src="${pageContext.request.contextPath}/plugins/datepicker/locales/bootstrap-datepicker.zh-CN.js"></script>
<script
	src="${pageContext.request.contextPath}/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js"></script>
<script
	src="${pageContext.request.contextPath}/plugins/slimScroll/jquery.slimscroll.min.js"></script>
<script
	src="${pageContext.request.contextPath}/plugins/fastclick/fastclick.js"></script>
<script
	src="${pageContext.request.contextPath}/plugins/iCheck/icheck.min.js"></script>
<script
	src="${pageContext.request.contextPath}/plugins/adminLTE/js/app.min.js"></script>
<script
	src="${pageContext.request.contextPath}/plugins/treeTable/jquery.treetable.js"></script>
<script
	src="${pageContext.request.contextPath}/plugins/select2/select2.full.min.js"></script>
<script
	src="${pageContext.request.contextPath}/plugins/colorpicker/bootstrap-colorpicker.min.js"></script>
<script
	src="${pageContext.request.contextPath}/plugins/bootstrap-wysihtml5/bootstrap-wysihtml5.zh-CN.js"></script>
<script
	src="${pageContext.request.contextPath}/plugins/bootstrap-markdown/js/bootstrap-markdown.js"></script>
<script
	src="${pageContext.request.contextPath}/plugins/bootstrap-markdown/locale/bootstrap-markdown.zh.js"></script>
<script
	src="${pageContext.request.contextPath}/plugins/bootstrap-markdown/js/markdown.js"></script>
<script
	src="${pageContext.request.contextPath}/plugins/bootstrap-markdown/js/to-markdown.js"></script>
<script
	src="${pageContext.request.contextPath}/plugins/ckeditor/ckeditor.js"></script>
<script
	src="${pageContext.request.contextPath}/plugins/input-mask/jquery.inputmask.js"></script>
<script
	src="${pageContext.request.contextPath}/plugins/input-mask/jquery.inputmask.date.extensions.js"></script>
<script
	src="${pageContext.request.contextPath}/plugins/input-mask/jquery.inputmask.extensions.js"></script>
<script
	src="${pageContext.request.contextPath}/plugins/datatables/jquery.dataTables.min.js"></script>
<script
	src="${pageContext.request.contextPath}/plugins/datatables/dataTables.bootstrap.min.js"></script>
<script
	src="${pageContext.request.contextPath}/plugins/chartjs/Chart.min.js"></script>
<script
	src="${pageContext.request.contextPath}/plugins/flot/jquery.flot.min.js"></script>
<script
	src="${pageContext.request.contextPath}/plugins/flot/jquery.flot.resize.min.js"></script>
<script
	src="${pageContext.request.contextPath}/plugins/flot/jquery.flot.pie.min.js"></script>
<script
	src="${pageContext.request.contextPath}/plugins/flot/jquery.flot.categories.min.js"></script>
<script
	src="${pageContext.request.contextPath}/plugins/ionslider/ion.rangeSlider.min.js"></script>
<script
	src="${pageContext.request.contextPath}/plugins/bootstrap-slider/bootstrap-slider.js"></script>
<script
	src="${pageContext.request.contextPath}/plugins/bootstrap-datetimepicker/bootstrap-datetimepicker.js"></script>
<script
	src="${pageContext.request.contextPath}/plugins/bootstrap-datetimepicker/locales/bootstrap-datetimepicker.zh-CN.js"></script>


<script type="text/javascript">
	function submitForm() {
		//回复的内容不能为空
		if ($("#content").val() == "" || $("#content").val().trim() == "") {
			//评论的内容为空，不提交
			alert("请输入评论的内容");
			return;
		}
		//回复的内容长度500字符
		if ($("#content").val().length > 500) {
			alert("评论的文本不能超过500字");
			return;
		}
		//表单提交
		$("#fomr1").submit();
		alert("提交评论成功");
	}
</script>

</html>